package com.example.xpvideo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 平台商品分类(LsGoodsCategory)实体类
 *
 * @author 杨丽辉
 * @since 2021-08-16 11:07:02
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class LsGoodsCategory implements Serializable {
    private static final long serialVersionUID = -90882719882437318L;
        /**
    *主键
    * id
    * isnull 1
    */
        private Integer id;

    /**
    * 分类名称
    * isnull 0
    */
    @NotEmpty(message = "请填写分类名称")
    private String name;
    /**
    * 父级id
    * isnull 0
    */
    @NotNull(message = "请选择上级")
    private Integer pid;
    /**
    * 等级
    * isnull 0
    */
    private Object level;
    /**
    * 排序
    * isnull 0
    */            private Integer sort;
    /**
    * 是否显示:1-是;0-否
    * isnull 0
    */            private Boolean isShow;
    /**
    * 分类图标
    * isnull 0
    */            private String image;
    /**
    * 首页分类背景图
    * isnull 0
    */            private String bgImage;
    /**
    * 分类描述
    * isnull 0
    */            private String remark;
    /**
    * 创建时间
    * isnull 0
    */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    /**
     * 更新时间
     * isnull 0
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    /**
    * 删除标志:1-是；0-否
    * isnull 0
    */            private Boolean del;

    public void setShow(Boolean show) {
        isShow = show;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @TableField(exist = false)
    //子菜单列表
    private List<LsGoodsCategory> children;

    public List<LsGoodsCategory> getChildren() {
        return children;
    }

    public void setChildren(List<LsGoodsCategory> children) {
        this.children = children;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
        
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
        
    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }
        
    public Object getLevel() {
        return level;
    }

    public void setLevel(Object level) {
        this.level = level;
    }
        
    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }
        
    public Object getIsShow() {
        return isShow;
    }

    public void setIsShow(Boolean show) {
        isShow = show;
    }

    public void setDel(Boolean del) {
        this.del = del;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }
        
    public String getBgImage() {
        return bgImage;
    }

    public void setBgImage(String bgImage) {
        this.bgImage = bgImage;
    }
        
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
        

    public Object getDel() {
        return del;
    }

    public Boolean getShow() {
        return isShow;
    }

    @Override
    public String toString() {
        return "{" +
                    " \"id\":" + id +
                                  " ,\"name\":" + name +
                            " ,\"pid\":" + pid +
                            " ,\"level\":" + level +
                            " ,\"sort\":" + sort +
                            " ,\"isShow\":" + isShow +
                            " ,\"image\":" + image +
                            " ,\"bgImage\":" + bgImage +
                            " ,\"remark\":" + remark +
                            " ,\"createTime\":" + createTime +
                            " ,\"updateTime\":" + updateTime +
                            " ,\"del\":" + del +
                  '}';
    }


}
